package com.ftwj.constant;


/**
 * 厂家接口调用异常
 *
 * @author: winelfeng
 * @date: 2021-01-06
 */
public class ApiException extends RuntimeException {

    private static final long serialVersionUID = 6659727010822192098L;

    private String code;
    private String message;

    public ApiException(String code, String msg) {
        this.code = code;
        this.message = msg;
    }

    public ApiException(ErrorCodeEnum errorCodeEnum) {
        this.code = errorCodeEnum.getCode();
        this.message = errorCodeEnum.getDescription();
    }

    @Override
    public String getMessage() {
        return message;
    }
}